package com.seaboxdata.util;

import java.io.IOException;
import java.math.BigDecimal;

/**
 * @author
 * @create 2020-12-31 11:19
 **/
public class Test {
    public static void main(String[] args) throws IOException {

        /*Configuration conf = new Configuration();
        if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
            System.setProperty("java.security.krb5.conf", "F:/dfjx/keytab/krb5.conf");
            System.setProperty("sun.security.krb5.debug", "false");
            conf.set("hadoop.security.authentication", "Kerberos");
            UserGroupInformation.setConfiguration(conf);
            conf.set("keytab.file", "F:/dfjx/keytab/hive.service.keytab");
            conf.set("kerberos.principal", "hive/dpzw-07@HADOOP.COM");
            try {
                UserGroupInformation.loginUserFromKeytab("hdfs-dpzw@HADOOP.COM", "F:/dfjx/keytab/hdfs.headless.keytab");
            } catch (IOException e) {
                e.printStackTrace();
            }
            FileSystem fs = FileSystem.get(URI.create("hdfs://172.21.17.46:8020"), conf);
            long spaceConsumed = fs.getContentSummary(new Path("/apps/hive/warehouse/landing_db.db")).getSpaceConsumed();
            long kb = spaceConsumed / 1024 / 3;
            if(kb > 1024){
                long m = kb / 1024;
                if(m > 1024){
                    long g = m / 1024;
                }
            }
        }*/

        long count = 3064528749L;

        BigDecimal bigDecimal = BigDecimal.valueOf(count);
        BigDecimal storage = bigDecimal
                .divide(BigDecimal.valueOf((1024L * 3L * 1024L * 1024L)), 2, BigDecimal.ROUND_HALF_UP);
        System.out.println("hehe" + storage);


    }
}
